<?php 
//Xử lý xóa
if(isset($_POST['XOA']))
{
	$id=$_POST['id'];
	$sql="DELETE FROM lienhe WHERE id='$id'";
	mysql_query($sql);
	header("Location: index.php?option=lienhe");
}
if(isset($_POST['HUY']))
{
	header("Location: index.php?option=lienhe");
}
//Xử lý thêm tin
if(isset($_POST['DANG']))
{

	$file=$_FILES['file']['name'];
	$lop=$_POST['lop'];
	$d=getdate();
    $time=gmdate("h:i:s", time()+7*3600);
    $datepost=$d['year']."-".$d['mon']."-".$d['mday']." ".$d['hours'].":".$d['minutes'].":".$d['seconds'];
	$sqlinsert="INSERT INTO upfile(lop,file,datepost)
	VALUES('$lop','$file','$datepost')";
	mysql_query("SET fileS utf8");
	mysql_query($sqlinsert);
///upload hình

	move_uploaded_file($_FILES['file']['tmp_name'],"../hoctap/baitap/"."$lop/".$file);
	header("Location: index.php?option=ketqua");
}
?>